-
Notifications
You must be signed in to change notification settings - Fork 580
feat(avm): avm fuzzer bytecode mutation #19378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: merge-train/avm
Are you sure you want to change the base?
feat(avm): avm fuzzer bytecode mutation #19378
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
93eb5a8 to
aa96990
Compare
52b4d03 to
fdd48ce
Compare
3700f20 to
3d86939
Compare
fdd48ce to
1b2d92c
Compare
3d86939 to
d39d11f
Compare
1b2d92c to
e6d52ef
Compare
d39d11f to
4168739
Compare
e6d52ef to
84fa05f
Compare
4168739 to
6f984cd
Compare
84fa05f to
1a64875
Compare
6f984cd to
fbabbed
Compare
5481b98 to
dd4e396
Compare
fbabbed to
ac33049
Compare
dd4e396 to
d5a76af
Compare
ac33049 to
3faa9e2
Compare
d5a76af to
a9f59ee
Compare
3faa9e2 to
35ef4be
Compare
a9f59ee to
5962f63
Compare
35ef4be to
a4be5dc
Compare
| std::function<void(T&, std::mt19937_64&)> mutate_element_function, | ||
| std::function<T(std::mt19937_64&)> generate_random_element_function, | ||
| const std::function<void(T&, std::mt19937_64&)>& mutate_element_function, | ||
| const std::function<T(std::mt19937_64&)>& generate_random_element_function, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these were missing from an earlier pr
Flakey Tests🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
sirasistant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
| } | ||
|
|
||
| // Apply public data tree writes (e.g., for contract instance upgrades) | ||
| if (!tx_data.public_data_writes.empty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do just
for (const auto& write : tx_data.public_data_writes) {
ws_mgr.public_data_write(write);
}
Introduces bytecode mutation using the standard
LLVMFuzzerMutate. We allow the mutated bytecode to expand up to 2x the original size.The mutation itself then utilises the contract upgrade path, this way we do not need to modify other classes or instances that may be used by other enqueued calls.
This does require the addition of public data writes as part of the setup to the fuzzer state (that also needs to happen in TS)